home = directory() /* Where we are executing this pgm from */
home = translate(home)
ydparms_dat = home || '\' || ydparms_dat /* All the parameters we need are here */
/* Abort if can't locate the ydparms_dat. Means we never ran the installer */
if stream(ydparms_dat, 'c', 'query exists') = '' then
do
go_exe = home || '\' || go_exe /* assume that's where it is */
call beep 1000, 200
say 'Cannot find YD_PARMS.DAT file with parameters needed to run.'
say 'This is normal if you have not run the installer,' YDINSTL_cmd
say 'or have not run it specifying a valid home directory.'
say ''
say 'Aborting. Press any key to exit. Then run' YDINSTL_cmd
call SysGetKey 'NOECHO'
signal goodbye
end
say 'Please wait while parameters load and we set up...'
call parms_from_ydparms_dat /* Read in all the parameters from the datafile */
/*
====================
(Re)set HOME and YARN environmental variables.
Later, in the dialup_server() routine, we will (re)set the NNTPSERVER (newsserver) environmental variable. In that routine we first decide which parameter from
the yd_parms.dat file has the correct newsserver assignment, then we set
NNTPSERVER to that
====================
*/
x = SetLocal()
x = value('home', home, 'OS2ENVIRONMENT')
x = value('yarn', yarn, 'OS2ENVIRONMENT')
/* We look for some obvious inconsistencies or omissions in YDPARMS_DAT */
call fatal_error_check
call directory_maintenance
/* are we connected? to whom? is it the right connection? */
call get_current_connection
/*
=============================================
This is the main menu. Point of interest: if we select 7
(souper options) we first dial in to the system and only
after we're connected do we get to select the options.
Then we get another menu asking if we want to get/send
stuff.
=============================================
*/
say ''
say 'Press:'
say '1 Only import Mail'
say '2 Only import News Articles'
say '3 Only import, but both Mail AND News'
say '4 Only export (send Mail, Posts, Replies, and Follow-ups)'
say '5 Everything: Get mail and news AND send Posts, Replies, and Follow-ups'
say '6 Complete an interrupted importation of mail/news'
say ' or rebuild a corrupted YARN history file'
say '7 Souper options: one-time-only changes in how souper runs:'
say ' Catchup on News'
say ' Maximum News Packet Size'
say ' Do not retrieve newsgroup articles Longer than set number of lines'
say ' Read-only for Mail: Don''t empty POP3 Mailbox'
say 'Pressing Esc key exits now. Enter Selection:'
do until pos(choice, '1234567') \= 0
choice = SysGetKey('NOECHO')
select
when choice = Escape then signal goodbye
when pos(choice, '1234567') = 0 then
do
say ''
say 'Selection' choice || '. Must be 1-7 or Escape key. Try again...'
say ''
end
otherwise NOP
end
say ''
say 'Selection: ' choice
say ''
end
/*
====================
A home\replies folder (empty) may be left behind as trash
after execution of mail/news retrieval from some Yarn/Souper
installations. We get rid of it if your setup of Yarn/Souper
leaves one behind.
====================
*/
replies_dir = home || '\replies'
call SysRmDir replies_dir
/* Fix the interrupted import */
if choice = pos(choice, 'xxxxx6x') then
do
call fix_import
signal goodbye /* Exit the program when done */
end
if choice = pos(choice, 'xxxxxx7') then
do
call SysCls
say ''
say 'You selected to modify souper options.'
say ''
say 'We will first dial in.'
say ''
say 'After a connection is successfully established you will'
say 'be asked to select your one-time-only souper options.'
say ''
say 'When you are finished with that, another menu will pop'
say 'up asking if you want to get news or mail, or send posts.'
say ''
say 'To quit now, press Escape'
say 'Any other key starts the dialup connection'
if SysGetKey('NOECHO') = Escape then signal goodbye
else NOP
end
call dialup_server
call time('R') /* start clock recording time on line */
/*
=================
These next conditionals process selections we made from the main menu.